﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TracNghiemV1.Database;

namespace TracNghiemV1.DAO
{
    class DataContextDao
    {
        private static TestDataDataContext m_dataContext = null;

        public static TestDataDataContext GetInstance(bool reset=false)
        {
            if (reset)
            {
                m_dataContext.Dispose();
                m_dataContext = null;
            }

            if (null == m_dataContext)
            {
                m_dataContext = new TestDataDataContext();
            }

            return m_dataContext;
        }

    }
}
